import request from '@/utils/request'

export const getCourseList = () => request.get('api/course/management/')

export const addCourse = (data) => request.post('api/course/management/', data)

export const updateCourse = (id, data) => request.put(`api/course/management/${id}/`, data)

export const deleteCourse = (id) => request.delete(`api/course/management/${id}/`)

// 获取课程下的班级列表
export const getClazzList = (courseId) => request.get(`api/course/management/${courseId}/classes/`)

// 在课程下新增班级
export const addClazz = (courseId, data) => request.post(`api/course/management/${courseId}/classes/`, data)

// 更新班级
export const updateClazz = (course_id, clazz_id, data) => request.put(`api/course/management/${course_id}/classes/${clazz_id}/`, data)
// 删除课程下的班级
export const deleteClazz = (course_id, clazz_id) => request.delete(`api/course/management/${course_id}/classes/${clazz_id}/`)
